<div class="entry" style="margin-top: 5px;">
	<div style="float: left;text-align: center;" class="rating-block-item">
		<div class="" style="padding-top: 10px;padding-bottom: 10px;">
			<? $this->widget("UserRating", array("item_id" => $service->id, "type" => Rating::TYPE_SERVICE, 'rating' => $service->rating, 'is_down' => Y::userId() !== $service->owner_id && empty($service->rt)));?>
		</div>
	</div>

	<h2 class="title"><?= CHtml::encode($service->title);?></h2>

	<div class="text-block">

		<p><?= YText::cleanRepair($service->text);?></p>

		<div style="float: left;width:350px;text-align: left;">
			<?= $service->getDownloadLink();?>

			<? $this->widget("ActionService", array(
                "service" => $service,
                'visible'=>($service->owner_id == Y::userId() || Y::user()->isModerator()) && $service->status ==0
            ));?>
		</div>
		<div style="float: right;width:350px;text-align: right;">
            <?= Yii::t("lan","{n} просмотр|{n} просмотра|{n} просмотров",$service->count_view);?> ::
			<em><?= DateTimer::getPeriod($service->t_create);?></em>

			<div>
				<b class="tegs">Метки:</b>
				<?  $i = 1; foreach ($service->tags as $tag) { ?>
				<?= CHtml::link($tag->name, "/service/list?filter=" . $tag->name) ?><?= count($service->tags) > $i
						? ", " : ""
				; ?>
				<? $i++;
			}?>
			</div>
		</div>

		<div class="clear"></div>
	</div>
	<div style="margin-left:90px;">
		<?php $this->widget('WSocialButton', array('style'=>'standard'));?>
	</div>

	<br/>
	<? if ($service->status == 1) { ?>
	<span class="error " style="margin-left:90px;">
            <?= $service->getStatusName();?>
        </span>
	<? }?>
	<div class="clear"></div>
</div>
<?if ($item_services || $item_suggests) { ?>
<div class="infobox" style="margin-left:90px;padding: 30px;border: 2px dashed #6DA3BD;">
	<div class="widget" style="float: left;width: 50%;border-right: 2px dashed #6DA3BD;">
		<?if ($item_services) { ?>
		<h5 class="widget-title" style="line-height: 16px;margin-bottom:4px; color:#666;">Похожие темы:</h5>
		<? foreach ($item_services as $item) { ?>
			<div>
				<a href="/service/<?= $item->id?>" style="font-size: 14px;"><?= $item->title;?></a>
			</div>
			<? } ?>
		<? }?>
	</div>

	<div class="widget" style="float: right;width: 45%;">
		<?if (Yii::app()->user->id == $service->owner_id && $item_suggests && $service->status == 0) { ?>
		<h5 class="widget-title" style="line-height: 16px;margin-bottom:4px; color:#666;">Возможно, помощь здесь:</h5>
		<? foreach ($item_suggests as $item) { ?>
			<div>
				<a href="/suggest/<?= $item->id?>" style="font-size: 14px;"><?= $item->title;?></a>
			</div>
			<? } ?>
		<? } ?>
	</div>
	<div class="clear"></div>
</div>
<? } ?>
<a name="comment"></a>

<hr/>
    <? if (count($service->comments) < 2) { ?>
   <div class="info" style="clear: both; ">
        Ту про то что ты можешь выбрать человека но нужно 2 комента
   </div>
<? } ?>
<? if ($service->comments) { ?>
<div class="content" id="blog">
	<h4>Комментарии (<?= count($service->comments);?>):</h4>
	<?php $this->renderPartial('_comment', array('service' => $service, 'comments' => $service->comments)); ?>
</div>
<? } ?>

<? if (Y::isAuthed() && $service->status == 0) { ?>

<div class="response">
	<h4>Оставить комментарий</h4>
	<?php if (Yii::app()->user->hasFlash('commentSubmitted')): ?>
	<div class="flash-success">
		<?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
	</div>
	<?php else: ?>
	<?php $this->renderPartial('/comment/_form', array('model' => $comment)); ?>
	<?php endif; ?>
</div>
<? } ?>



